﻿<UserControl x:Class="SharePointSearchBench.UI.Controls.ContextInfo"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>
        <ControlTemplate TargetType="ComboBox" x:Key="serviceDependentCombo">
            <ComboBox IsReadOnly="False" IsEditable="True" IsEnabled="{Binding ElementName=webServiceButton, Path=IsChecked}"/>
        </ControlTemplate>
    </UserControl.Resources>
        <GroupBox Header="Connection Type" MinWidth="150" HorizontalAlignment="Stretch">
            <StackPanel>
                <WrapPanel Orientation="Horizontal">
                    <RadioButton IsChecked="True" x:Name="objectModelButton">Object Model</RadioButton>
                    <RadioButton x:Name="webServiceButton">Web Service</RadioButton>
                </WrapPanel>
                <StackPanel Visibility="Visible" x:Name="webServiceConnectionPanel">
                    <StackPanel>
                        <TextBlock>Service or Site Url:</TextBlock>
                        <ComboBox x:Name="contextUrlComboBox" />
                    </StackPanel>

                    <StackPanel>
                        <TextBlock>Domain:</TextBlock>
                        <ComboBox x:Name="domainComboBox" Template="{StaticResource serviceDependentCombo}"/>
                    </StackPanel>

                    <StackPanel>
                        <TextBlock IsEnabled="False">Username:</TextBlock>
                        <ComboBox x:Name="usernameComboBox" Template="{StaticResource serviceDependentCombo}"/>
                    </StackPanel>

                    <StackPanel>
                        <TextBlock IsEnabled="False">Password:</TextBlock>
                        <PasswordBox x:Name="passwordTextBox" IsEnabled="{Binding ElementName=webServiceButton, Path=IsChecked}"/>
                    </StackPanel>

                </StackPanel>
            </StackPanel>
        </GroupBox>


</UserControl>
